<?php

class Kd_Validation_Validator {

    private $_data = NULL;

    public function __construct($data = array()) {
        $this->setData($data);
    }

    public function setData(array $value){
        $this->_data = $value;
        return $this;
    }

    public function getValue($name){
        if(array_key_exists($name, $this->_data)){
            return $this->_data[$name];
        }
        return NULL;
    }

    public function isNotEmpty($name){
    	return Kd_Validate::isNotEmpty($this->getValue($name));
    }

    public function isInteger($name){
        return Kd_Validate::isInteger($this->getValue($name));
    }
    
    public function getNotEmpty($name, $default = NULL){
    	if($this->isNotEmpty($name)){
    		return $this->getValue($name);
    	}
    	return $default;
    }    
    
    public function getInteger($name, $default = NULL){
    	if($this->isInteger($name)){
    		return $this->getValue($name);
    	}
    	return $default;
    }
}